/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package LiveReservations.model;

/**
 * A controller that manages business customer capacity
 * @author Grigorios
 */
public final class SeatManager {

    private int estSeatNum;
    private int curSeatNum;

    public SeatManager(int estSeats) 
    {
        this.curSeatNum = estSeats;
        this.curSeatNum = estSeats;
    }

    public int getEstSeatNum() 
    {
        return estSeatNum;
    }

    public int getCurSeatNum() 
    {
        return curSeatNum;
    }
    
    public boolean available(int quantity)
    {
        return curSeatNum >= quantity;
    }

    public boolean reserve(int quantity) 
    {
        if(curSeatNum >= quantity)
        {
            curSeatNum -= quantity;
            return true;
        }
        else
        {
            return false;
        }
    }
    
    public void reset()
    {
        curSeatNum = estSeatNum;
    }
}
